package edu.wpi.first.wpilibj.defaultCode;

import edu.wpi.first.wpilibj.Timer;



/**
 * TODO: This class needs to be tested.
 *
 * @author Fondy Fire
 */
public class TimerFF {

    /** The time the last frame took in milliseconds */
    public double frameMilli;
    /** Last reading on the timer nSeconds */
    private double lastTimer;
    /** The total milliseconds elapsed since the call to init()*/
    public double elapsedMilli;
    /** the first time reading nSeconds */
    private double firstTimer;



    public void init(){
        lastTimer = Timer.getUsClock();
        firstTimer = lastTimer;
        frameMilli = 0;
    }

    public void update(){
        frameMilli = (Timer.getUsClock() - lastTimer) / 1000.0;
        elapsedMilli = (Timer.getUsClock() - firstTimer) / 1000.0;
        lastTimer = Timer.getUsClock();
    }
}
